#ifndef GAME_H
#define GAME_H

#include "Singleton.h"

#include <QDebug>
#include <QList>


class Scanner {
  public:
    Scanner(){}
    virtual void Scan()
    {
        qInfo()<<__FUNCTION__;
    }
};

class ProgramNode {
public:
    ProgramNode(){}
    virtual void Add(ProgramNode*){}
    virtual void Remove(ProgramNode*){}
};

class ProgramNodeBuilder {
public:
    ProgramNodeBuilder(){}
    virtual ProgramNode* NewVariable() const{
        return new ProgramNode;
    }
    virtual ProgramNode* NewCodition() const{
        return new ProgramNode;
    }
    ProgramNode* GetRootNode(){ return _node; }
private:
    ProgramNode* _node;
};

class Parser {
public:
    Parser(){}
    virtual void Parse(Scanner& s, ProgramNodeBuilder& b)
    {
        qInfo()<<__FUNCTION__;
        s.Scan();
        b.NewVariable();
        b.NewCodition();
    }
};

class Compiler {
public:
    Compiler(){}
    virtual void Compile()
    {
        qInfo()<<__FUNCTION__;
        Scanner scanner;
        ProgramNodeBuilder build;
        Parser parser;

        parser.Parse(scanner, build);
    }
};


#endif // GAME_H
